export function uploadImage (successCallback) {
	uni.chooseImage({
		success: function(res) {
			uni.showLoading({
				title: '图片上传中',
			});
			uni.uploadFile({
				header: {'Authorization': uni.getStorageSync('token')},
				url: '/prod-api' + '/api.app/v1/files/upload',
				file: res.tempFilePaths[0],
				filePath: res.tempFilePaths[0],
				name: 'file',
				fileType: 'image',
				formData: {},
				success: function(res) {
					uni.hideLoading();
					if (res.statusCode == 403) {
						uni.showToast({
							title: res.data,
							icon:"none",
							duration: 2000
						});
					}else {
						let data = res.data ? JSON.parse(res.data) : {};
						if (res.statusCode == 200) {
							if (data.code == '00000') {
								successCallback && successCallback(data)
							}else {
								uni.showToast({
									title: data.msg,
									icon:"none",
									duration: 2000
								});
							}
						}else {
							uni.showToast({
								title: data.message,
								icon:"none",
								duration: 2000
							});
						}
					}
				},
				
				fail:function(info) {
					uni.hideLoading();
					uni.showToast({
						title:'上传失败, 请重新上传',
						icon:'none'
					})
				}
			})
		}
	})
}